<cfcomponent>
<cfset this.name = "babylonserver">
<cfset this.sessionmanagement="true">
<cfset this.loginstorage="session">

<cffunction name="OnApplicationStart">
  <cfobject name="bab" component="babylon">
	<cfset application.babylonserver = bab.getBabylonServer()>
</cffunction>

<cffunction name="OnRequestStart">
	<cfargument name = "request" required="true"/>
  <cfobject name="bab" component="babylon">
	<cfif structKeyExists(form,"startServer")>
  	<cfif NOT structKeyExists(application,"babylonserver")>
			<cfset application.babylonserver = bab.getBabylonServer()>
		</cfif>
	</cfif>
	
	<cfif structKeyExists(form,"stopServer")>
		<!---<cfset application.babylonserver.shutdown()> --->
		<cfset bab.stopBabylonServer(application.babylonserver)>
	</cfif>

</cffunction>

<cffunction name="OnApplicationEnd">
	<!--- not working, this whole thing is a kludge  --->
	<cfset bab.stopBabylonServer(application.babylonserver)>
</cffunction>

</cfcomponent>